import request from "@/axios";

export function getMyOrder(status){
    return request({
        url: '/mew/order/list',
        method: 'get',
        params: {
            status
        }
    })
}

export function getOrderInfo(orderId){
    return request({
        url: '/mew/order/info/' + orderId,
        method: 'get'
    })
}

export function getStationList(){
    return request({
        url: '/mew/order/stationlist',
        method: 'get'
    })
}

export function getDefaultAddress(){
    return request({
        url: '/mew/order/myDefaultAddress',
        method: 'get'
    })
}

export function updateOrSaveOrder(data){
    return request({
        url: data.orderId ? '/mew/order/update' : '/mew/order/save',
        method: 'post',
        data
    })
}

export function change(orderId, status){
    return request({
        url: '/mew/order/change/'+ orderId+ '/' + status,
        method: 'get'
    })
}

export function orderStatus(status){
    return request({
        url: '/mew/order/status/' + status,
        method: 'get'
    })
}